<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_EN" lang="en_En">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script src="<?php echo base_url()?>js/jquery-1.6.4.min.js" type="text/javascript"></script>
		<script src="<?php echo base_url()?>js/highcharts.js" type="text/javascript"></script>
		<script src="<?php echo base_url()?>js/exporting.js" type="text/javascript"></script>
		<script src="<?php echo base_url()?>js/jqueryui/js/jquery.ui.core.min.js"></script>
		<script src="<?php echo base_url()?>js/jqueryui/js/jquery.ui.widget.min.js"></script>
		<script src="<?php echo base_url()?>js/jqueryui/js/jquery.ui.mouse.min.js"></script>
		<script src="<?php echo base_url()?>js/jqueryui/js/jquery.ui.slider.min.js"></script>
		<script src="<?php echo base_url()?>js/equalizer.js" type="text/javascript"></script>
		
		<link rel="stylesheet" href="<?php echo base_url()?>css/style.css" type="text/css"/>
		<link rel="stylesheet" href="<?php echo base_url()?>css/highslide.css" type="text/css"/>
		
		<link rel="stylesheet" href="<?php echo base_url()?>js/jqueryui/css/jquery.ui.slider.css" type="text/css"/>
		<title>E-lizer: Congratulations</title>
		<base href="<?php echo base_url()?>" />
		<?php 
		 if(!isset($userData1) || $userData1 == null){
			$trustValue1 = 0;
			$respectValue1 = 0;
			$careValue1 = 0;
			$commitmentValue1 = 0;
			$financialValue1 = 0;
			$domestricValue1 = 0;
			$intimacyValue1 = 0;
			$physicalValue1 = 0;
			$funTimeValue1 = 0;
			$bestFriendValue1 = 0;
			$spiritualIntimacyValue1 = 0;
			$conflictResolutionValue1 = 0;	
		 }else{
			$trustValue1 = $userData1->trust;
			$respectValue1 = $userData1->respect;
			$careValue1 = $userData1->care;
			$commitmentValue1 = $userData1->commitment;
			$financialValue1 = $userData1->financial_support;
			$domestricValue1 = $userData1->domestric_support;
			$intimacyValue1 = $userData1->intimacy;
			$physicalValue1 = $userData1->physical_appearance;
			$funTimeValue1 = $userData1->fun_time_together;
			$bestFriendValue1 = $userData1->best_friend_talk;
			$spiritualIntimacyValue1 = $userData1->spiritual_intimacy;
			$conflictResolutionValue1 = $userData1->conflict_resolution;
		 }
		 if(!isset($userData2) || $userData2 == null){
			$trustValue2 = 0;
			$respectValue2 = 0;
			$careValue2 = 0;
			$commitmentValue2 = 0;
			$financialValue2 = 0;
			$domestricValue2 = 0;
			$intimacyValue2 = 0;
			$physicalValue2 = 0;
			$funTimeValue2 = 0;
			$bestFriendValue2 = 0;
			$spiritualIntimacyValue2 = 0;
			$conflictResolutionValue2 = 0;		
		 }else{
			$trustValue2 = $userData2->trust;
			$respectValue2 = $userData2->respect;
			$careValue2 = $userData2->care;
			$commitmentValue2 = $userData2->commitment;
			$financialValue2 = $userData2->financial_support;
			$domestricValue2 = $userData2->domestric_support;
			$intimacyValue2 = $userData2->intimacy;
			$physicalValue2 = $userData2->physical_appearance;
			$funTimeValue2 = $userData2->fun_time_together;
			$bestFriendValue2 = $userData2->best_friend_talk;
			$spiritualIntimacyValue2 = $userData2->spiritual_intimacy;
			$conflictResolutionValue2 = $userData2->conflict_resolution;
		 }
		 ?>
		<script type="text/javascript">
			var chart;
			$(document).ready(function() {
				chart = new Highcharts.Chart({
					colors: [
						'#DE208C',
						'#52308C',
						'#9966cc', 
						'#ff9900', 
						'#89A54E', 
						'#80699B', 
						'#3D96AE', 
						'#DB843D', 
						'#92A8CD', 
						'#A47D7C', 
						'#B5CA92'
					],
					chart: {
						renderTo: 'container',
						defaultSeriesType: 'line',
						marginRight: 0,
						marginLeft: -10,
						height: 325,
						width: 985,
						plotBackgroundImage: '<?php echo base_url()?>css/imgs/highchart-bg.png',
						plotBorderColor: '#FFFFFF',
						className : "chart-container",
						marginBottom: 0
					},
					title: {
						text: '',
						x: 5 //center
					},
					subtitle: {
						text: '',
						x: -20
					},
					symbols: [
					      	'circle',
					      	'circle',
					      	'diamond', 
					      	'square', 
					      	'triangle', 
					      	'triangle-down'
					      ],
					xAxis: {
						lineColor: '#FF0000',
						lineWidth: 0,
						labels: {
							style: {
								color: '#FFFFFF'
							}
						},
						tickLength : 0,
						categories: ['Trust', 'Respect', 'Care', 'Commitment', 'Financial Support', 'Domestric Support', 
							'Intimacy', 'Physical Appearance Attractive', 'Fun Time Together', '"Best Friend" Talk', 'Spiritual Intimacy', 'Conflict Resolution']
					},
					yAxis: {
						title: {
							text: ''
						},
						lineColor: '#FF0000',
						labels: {
				            align: 'right',
				            x: 35,
				            y: 5
				        },
						lineWidth: 0,
						max : 10.1,
						min: -0.1,
						tickLength : 1,
						showLastLabel: false,
						showFirstLabel: false,
						tickInterval: 1,
						gridLineWidth: 0
					},
					tooltip: {
						formatter: function() {
				                return '<b>'+ this.series.name +'</b><br/>'+
								this.x +': '+ this.y;
						}
					},
					legend: {
						layout: 'vertical',
						align: 'right',
						verticalAlign: 'top',
						x: -100,
						y: -15,
						borderWidth: 0
					},
					series: [{
						name: 'Present',
						data: [<?php echo $trustValue1/10 ?>, <?php echo $respectValue1/10 ?>, <?php echo $careValue1/10 ?>, <?php echo $commitmentValue1/10 ?>, <?php echo $financialValue1/10 ?>, <?php echo $domestricValue1/10 ?>, <?php echo $intimacyValue1/10 ?>, <?php echo $physicalValue1/10 ?>, <?php echo $funTimeValue1/10 ?>, <?php echo $bestFriendValue1/10?>, <?php echo $spiritualIntimacyValue1/10 ?>, <?php echo $conflictResolutionValue1/10 ?>]
						}, {
						name: 'Desire',
						data: [<?php echo $trustValue2/10 ?>, <?php echo $respectValue2/10 ?>, <?php echo $careValue2/10 ?>, <?php echo $commitmentValue2/10 ?>, <?php echo $financialValue2/10 ?>, <?php echo $domestricValue2/10 ?>, <?php echo $intimacyValue2/10 ?>, <?php echo $physicalValue2/10 ?>, <?php echo $funTimeValue2/10 ?>, <?php echo $bestFriendValue2/10?>, <?php echo $spiritualIntimacyValue2/10 ?>, <?php echo $conflictResolutionValue2/10 ?>]
					}],
					exporting:{
				        buttonOptions: {
			            	enabled: false
			        	}
					},
					navigation: {
				        buttonOptions: {
				            enabled: false
				        }
				    }
				});				
			});
			$(document).ready(function() {
				$(".indicator-label-item > a").each(function(index) {
					$(this).bind({
						click: function() {
							$(".indicator-label-item > a").removeClass("indicator-marked");
							$(this).addClass("indicator-marked");
							return false;
						}
					});
				});
			});
		</script>
	</head>
	<body id="step2">
		<div id="wrapper">
			<div id="header-wrapper">
				<?php include_once('include/header.php') ?>
			</div>
			<div id="content">
				<div id="content-step2">
					<h2 class="page-header">Congratulations to you with completion of this very important exercise!</h2>
					<p>You have pretty accurate picture on "ugly truth" or "lovely reality" of your personal relationship.</p>
					<p>The <span class="blue-text bold-text">blue</span> diagram represents the qualities of the partner in the relationship that you had hoped you would be in; and the <span class="pink-text bold-text">pink</span> diagram represents how you rated the qualities of your actual partner right now.</p>
					<div id="chart">
						<div id="container" style="margin: 0 auto"></div>
						<div class="clear"></div>
						<div id="indicator-label">
							<div class="indicator-label-item indicator-label-item-first"><a id="indicator1" name="trust-slider" href="#"><span>Trust</span></a></div>
							<div class="indicator-label-item"><a id="indicator2" name="respect-slider" href="#"><span>Respect</span></a></div>
							<div class="indicator-label-item"><a id="indicator3" name="care-slider"  href="#"><span>Caring</span></a></div>
							<div class="indicator-label-item"><a id="indicator4" name="commitment-slider"  href="#"><span>Commitment</span></a></div>
							<div class="indicator-label-item"><a id="indicator5" name="financial-slider"  href="#"><span>Financial Support</span></a></div>
							<div class="indicator-label-item"><a id="indicator6" name="domestric-slider"  href="#"><span>Domestic Support</span></a></div>
							<div class="indicator-label-item"><a id="indicator7" name="intimacy-slider"  href="#"><span>Intimacy</span></a></div>
							<div class="indicator-label-item"><a id="indicator8" name="physical-slider"  href="#"><span>Physical Appearance/ Attractiveness</span></a></div>
							<div class="indicator-label-item"><a id="indicator9" name="fun-time-slider"  href="#"><span>Fun/<br/>Quality Time<br/>Together</span></a></div>
							<div class="indicator-label-item"><a id="indicator10" href="#"><span>"Best<br/>Friend<br/>Talk"</span></a></div>
							<div class="indicator-label-item"><a id="indicator11" href="#"><span>Spiritual Intimacy</span></a></div>
							<div class="indicator-label-item indicator-label-item-last"><a id="indicator12" href="#"><span>Conflict Resolution</span></a></div>
							<div class="clear"></div>
						</div>
						<div id="indicator-result">
							<div class="indicator-result-item indicator-result-item-first"><a id="indicator1" name="trust-slider" href="#"><span><?php echo calSatisfied($trustValue1, $trustValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator2" name="respect-slider" href="#"><span><?php echo calSatisfied($respectValue1, $respectValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator3" name="care-slider"  href="#"><span><?php echo calSatisfied($careValue1, $careValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator4" name="commitment-slider"  href="#"><span><?php echo calSatisfied($commitmentValue1, $commitmentValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator5" name="financial-slider"  href="#"><span><?php echo calSatisfied($financialValue1, $financialValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator6" name="domestric-slider"  href="#"><span><?php echo calSatisfied($domestricValue1, $domestricValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator7" name="intimacy-slider"  href="#"><span><?php echo calSatisfied($intimacyValue1, $intimacyValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator8" name="physical-slider"  href="#"><span><?php echo calSatisfied($physicalValue1, $physicalValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator9" name="fun-time-slider"  href="#"><span><?php echo calSatisfied($funTimeValue1, $funTimeValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator10" name="best-friend-slider"  href="#"><span><?php echo calSatisfied($bestFriendValue1, $bestFriendValue2); ?></span></a></div>
							<div class="indicator-result-item"><a id="indicator11" name="spiritual-intimacy-slider"  href="#"><span><?php echo calSatisfied($spiritualIntimacyValue1, $spiritualIntimacyValue2); ?></span></a></div>
							<div class="indicator-result-item indicator-result-item-last"><a id="indicator12" name="conflict-resolution-slider"  href="#"><span><?php echo calSatisfied($conflictResolutionValue1, $conflictResolutionValue2); ?></span></a></div>
							<div class="clear"></div>
						</div>
					</div>
					<div class="clear"></div>
					<div id="step1-end">
					</div>
					<?php
						function calSatisfied($value1, $value2){
							if(($value1 - $value2) >= 0){
								return "";
							}else{
								$first = 1000/$value2;
								$second = $first*$value1/10;
								return floor(100 - $second)."% <br/>unsatisfied";
							}
						} 
					?>
					<?php
					if($user->username != "demohus" && $user->username != "demowife" && false){ 
					?>
					<p>Please note that the eLizer you have used is a demo. The summary below <strong><i>is not</i></strong> an evaluation of <strong><i>your</i></strong> personal relationship, but rather an example of one that you might receive in the actual program</p>
					<?php
					} 
					?>
					<?php
					if($user->username == "demohus" || $user->username == "demowife"){ 
					?>					
					<p class="bold-text">e-Lizer Results on Your View of the Relationship</p>
					<p>Your evaluation of your partner's qualities during the e-Lizer tests show that there are gaps in these specific areas that are preventing you from having a satisfying relationship.</p>
					<p class="bold-text">
					-           You do not feel appreciated and you feel like your partner does not show enough care and concern for you.  
					</p>
					<p class="bold-text">
					-           You do not feel like your partner is fully committed to you or feels a sense of responsibility towards you and your mutual interests.
					</p>
					<p class="bold-text">
					-           You do not feel like your partner is providing financial support to you. 
					</p>
					<p class="bold-text">
					-           You do not feel like your partner helping you enough to create a peaceful and well-managed home environment.
					</p>
					<p class="bold-text">
					-           You do not have a strong need for intimacy; however, your relationship is completely lacking sexual and intimate fulfillment.
					</p>
					<p class="bold-text">
					-           You do not enjoy enough fun/quality time with your partner on an every day basis; receiving undivided attention. 
					</p>
					<p class="bold-text">
					-           You would like to have more open communication with your partner, being able to share and openly discuss your glories and worries with him/her.  
					</p>
					<p class="bold-text">
					-           You do not feel that your partner has an ability to resolve conflict in your relationship in a calm, peaceful way.  
					</p>
					<p class="bold-text">
					-           Your relationship is completely lacking spiritual intimacy.  
					</p>
					<?php
					}
					?>
					<p class="print-link">You may click here to print your results: <a href="#" onclick="window.print();return false">print</a></p>
					
					<p>Please click the "send" button to forward the results to our office for the evaluation.</p>
					<div class="next-button">
						<?php echo form_open('client'); ?>
							<input type="hidden" id="step" name="step" value="6" />
							<input id="next-button" type="submit" name="nextstep" value="Send" />
						</form>
					</div>
				</div>
			</div>
			<div id="footer-wrapper">
				<?php include_once('include/footer.php') ?>
			</div>
		</div>
	</body>
</html>